function __G__TRACKBACK__(errorMessage)
    print("----------------------------------------")
    print("LUA ERROR: " .. tostring(errorMessage) .. "\n")
    print(debug.traceback("", 2))
    mgrs.event:dispatchEvent({name = enums.Event.APPError,info = errorMessage});
    print("----------------------------------------")
end	
cc.FileUtils:getInstance():setPopupNotify(false);
local target = cc.Application:getInstance():getTargetPlatform()
local paths = cc.FileUtils:getInstance():getSearchPaths();
if target == 0 then
    package.path = package.path .. ";code/";
    table.insert(paths,"../../../pkg/")
else
    package.path = package.path .. ";src/";
end
local writePath = cc.FileUtils:getInstance():getWritablePath()
table.insert(paths,1,writePath);
local UPD_FOLDER = writePath .. "upd/";
table.insert(paths,1,UPD_FOLDER);
table.insert(paths,2,UPD_FOLDER .. "res/");
table.insert(paths,3,UPD_FOLDER .. "src/");
table.insert(paths,4,"res/");
table.insert(paths,5,"src/");
cc.FileUtils:getInstance():setSearchPaths(paths);
cc.Director:getInstance():setAnimationInterval(1.0 / 60);
require("config")
require("cocos.init")
require("framework.init")
local paths = cc.FileUtils:getInstance():getSearchPaths();
local MainScene = require(SCRIPTS_DIR .. ".scenes.MainScene");
--local MainScene = require("scripts" .. ".scenes.UpdateScene");
cc.Director:getInstance():replaceScene(MainScene.new());



